const { pharmacy } = require('.')

module.exports = (sequelize, Sequelize) => {
	const pharmacy = sequelize.define(
		'pharmacy_info',
		{
			pharmacyId: { type: Sequelize.STRING(10), primaryKey: true },
			pharmacyName: { type: Sequelize.STRING(10), allowNull: false },
			pharmacyPlace: { type: Sequelize.STRING(100), allowNull: false },
			pharmacyTimebeg: { type: Sequelize.DATE(6), allowNull: false },
			pharmacyTimeend: { type: Sequelize.DATE(6), allowNull: false },
			pharmacyScore: { type: Sequelize.TINYINT(1) },
			hot: { type: Sequelize.TINYINT(1), defaultValue: 0 },
			pharmacyPermit: { type: Sequelize.STRING(20) },
		},
		{
			// 禁止 updatedAt, createdAt 自增
			timestamps: false,
			// 自定义表名
			freezeTableName: true,
		}
	)

	return pharmacy
}
